package com.ecarx.camera.ui.dialog;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;

import com.ecarx.camera.R;
import com.ecarx.camera.utils.Utils;
import com.ecarx.camera.ui.BaseDialog;

public class MessageDialog extends BaseDialog {

    private TextView tvMessage;

    private CharSequence message;

    public static MessageDialog newInstance() {
        MessageDialog messageDialog = new MessageDialog();
        return messageDialog;
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.dialog_message;
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    protected void bindViews() {
        super.bindViews();
        tvMessage = layoutRoot.findViewById(R.id.tv_message);

        tvMessage.setText(message);
    }

    @Override
    protected void initViews() {
        super.initViews();
        tvMessage.setTextColor(ContextCompat.getColor(Utils.getApp(), R.color.camera_base_day_night_fg_color));
    }

    public MessageDialog setMessage(@NonNull CharSequence message) {
        this.message = message;
        return this;
    }
}
